package com.file.controller;

import com.file.form.result.ImgResultForm;
import com.file.service.IOSSFileProcessService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * Created by chairal on 2016/7/21.
 * 使用阿里云对象存储处理文件的访问上传下载
 */
@RestController
@RequestMapping("/oss/file")
public class OSSFileProcessController {

    @Autowired
    IOSSFileProcessService oSSFileProcessService;

    /**
     * oss上传图片
     *
     * @param request
     * @return
     */
    @RequestMapping("/upload")
    public ImgResultForm uploadImage(String project, String type, HttpServletRequest request) {
        return oSSFileProcessService.uploadImage(project, type, request);
    }

    //todo 修改图片后删除历史图片

}
